/**
 * <pre>
 * Title: 		PropertyConfig.java
 * Project: 	Common-Util
 * Author:		linriqing
 * Create:	 	2012-5-22 上午10:55:32
 * Copyright: 	Copyright (c) 2012
 * Company:		Shenzhen Helper
 * <pre>
 */
package com.hengpeng.common.web.tags.vo;

import com.hengpeng.common.web.annotation.HtmlInput;
import com.hengpeng.common.web.annotation.HtmlInputPattern;
import com.hengpeng.common.web.annotation.HtmlInputType;

/**
 * <pre>
 * TODO 输入类型说明
 * </pre>
 * @author linriqing
 * @version 1.0, 2012-5-22
 */
public class PropertyConfig
{
	private String cssClass;

	private Class<?> elementType;

	private String format;

	private int index;

	private String items;

	private String label;

	private String labelProperty;

	private String inputId;

	private int maxLength;

	private int minLength;

	private boolean nullable;

	private HtmlInputPattern pattern;

	private String style;

	private String tips;

	private HtmlInputType type;

	private String valueProperty;

	public PropertyConfig(HtmlInput htmlInput)
	{
		cssClass = htmlInput.cssClass();
		elementType = htmlInput.elementType();
		format = htmlInput.format();
		index = htmlInput.index();
		items = htmlInput.items();
		label = htmlInput.label();
		labelProperty = htmlInput.labelProperty();
		maxLength = htmlInput.maxLength();
		minLength = htmlInput.minLength();
		nullable = htmlInput.nullable();
		pattern = htmlInput.pattern();
		style = htmlInput.style();
		inputId = htmlInput.inputId();
		tips = htmlInput.tips();
		type = htmlInput.type();
		valueProperty = htmlInput.valueProperty();
	}

	/**
	 * @return css样式类名
	 */
	public String cssClass()
	{
		return cssClass;
	}

	/**
	 * @return 如果属性定义为集合，需要给出集合元素的类型
	 */
	public Class<?> elementType()
	{
		return elementType;
	}

	/**
	 * @return 输出格式
	 */
	public String format()
	{
		return format;
	}

	/**
	 * @return 控件显示的顺序
	 */
	public int index()
	{
		return index;
	}

	/**
	 * @return 控件ID
	 */
	public String inputId()
	{
		return inputId;
	}

	/**
	 * @return 集合，Map，数组对象名称
	 */
	public String items()
	{
		return items;
	}

	/**
	 * @return 显示名称
	 */
	public String label()
	{
		return label;
	}

	/**
	 * @return 属性为对象时，取显示名称的字段名
	 */
	public String labelProperty()
	{
		return labelProperty;
	}

	/**
	 * @return 字段最大长度校验
	 */
	public int maxLength()
	{
		return maxLength;
	}

	/**
	 * @return 字段最小长度校验
	 */
	public int minLength()
	{
		return minLength;
	}

	/**
	 * @return 字段是否允许空值
	 */
	public boolean nullable()
	{
		return nullable;
	}

	/**
	 * @return 字段校验格式
	 */
	public HtmlInputPattern pattern()
	{
		return pattern;
	}

	public void setCssClass(String cssClass)
	{
		this.cssClass = cssClass;
	}

	public void setElementType(Class<?> elementType)
	{
		this.elementType = elementType;
	}

	public void setFormat(String format)
	{
		this.format = format;
	}

	public void setIndex(int index)
	{
		this.index = index;
	}

	public void setInputId(String inputId)
	{
		this.inputId = inputId;
	}

	public void setItems(String items)
	{
		this.items = items;
	}

	public void setLabel(String label)
	{
		this.label = label;
	}

	public void setLabelProperty(String labelProperty)
	{
		this.labelProperty = labelProperty;
	}

	public void setMaxLength(int maxLength)
	{
		this.maxLength = maxLength;
	}

	public void setMinLength(int minLength)
	{
		this.minLength = minLength;
	}

	public void setNullable(boolean nullable)
	{
		this.nullable = nullable;
	}

	public void setPattern(HtmlInputPattern pattern)
	{
		this.pattern = pattern;
	}

	public void setStyle(String style)
	{
		this.style = style;
	}

	public void setTips(String tips)
	{
		this.tips = tips;
	}

	public void setType(HtmlInputType type)
	{
		this.type = type;
	}

	public void setValueProperty(String valueProperty)
	{
		this.valueProperty = valueProperty;
	}

	/**
	 * @return css样式
	 */
	public String style()
	{
		return style;
	}

	/**
	 * @return 字段控件输入提示
	 */
	public String tips()
	{
		return tips;
	}

	/**
	 * @return 控件类型
	 */
	public HtmlInputType type()
	{
		return type;
	}

	/**
	 * @return 属性为对象时，取值的字段名
	 */
	public String valueProperty()
	{
		return valueProperty;
	}
}
